package com.uoko.fileupload.util;

import javax.imageio.ImageIO;
import javax.imageio.stream.ImageInputStream;
import java.io.File;
import java.io.IOException;

/**
 * <p>
 * 判断文件格式是否是img
 * </p>
 *
 * @author shaohua
 * Email shaohua@uoko.com
 * created by 2018/6/8
 */
public class IsImag {

    public static boolean isImag(File tempFile) throws IOException {
        ImageInputStream imageInputStream = ImageIO.createImageInputStream(tempFile);
        return imageInputStream != null;
    }
}
